<template>
	<view class="container">
		<u-loading-icon color="#39B19D" size="80"></u-loading-icon>
		<view style="text-align: center;margin-top: 50rpx;" class="">加載中...</view>
	</view>
</template>

<script>
	import {
		getPaymentAfterOrderInfo
	} from '@/api/order.js'
	export default {
		data() {
			return {

			};
		},
		onLoad(option) {
			if (option.type) {
				this.jumpFn(option.type)
			} else {
				this.init()
			}
		},
		methods: {
			init() {
				getPaymentAfterOrderInfo({
					order_no: uni.getStorageSync('MerchantTradeNo')
				}).then(res => {
					console.log(res)
					switch (Number(res.data.type)) {
						case 0:
							uni.reLaunch({
								// url: "/pages/balance/balance"
								url: '/pages/me/me'
							})
							break;
						case 1:
							uni.reLaunch({
								// url: '/pages/electronic_ticket_roll/electronic_ticket_roll'
								url: '/pages/me/me'
							})
							break;
						case 2:
							uni.reLaunch({
								// url: '/pages/me/stored_value_card/stored_value_card'
								url: '/pages/me/me'
							})
							break;
						case 3:
							uni.reLaunch({
								url: '/pages/order/order'
							})
							break;
						case 4:
							uni.reLaunch({
								url: '/pages/order/order'
							})
							break;
					}
				})
			},
			jumpFn(type) {
				switch (Number(type)) {
					case 1:
						uni.reLaunch({
							url: '/pages/order/order'
						})
						break;
					case 2:
						uni.reLaunch({
							url: '/pages/order/order'
						})
						break;
					case 3:
						uni.reLaunch({
							// url: "/pages/balance/balance"
							url: "/pages/me/me"
						})
						break;
					case 4:
						uni.reLaunch({
							// url: '/pages/electronic_ticket_roll/electronic_ticket_roll'
							url: '/pages/me/me'
						})
						break;
					case 5:
						uni.reLaunch({
							// url: '/pages/me/stored_value_card/stored_value_card'
							url: '/pages/me/me'
						})
						break;
				}
			}
		}
	}
</script>

<style lang="less">
	.container {
		width: 100vw;
		height: 100vh;
		padding-top: 100rpx;
		box-sizing: border-box;
		// display: flex;
		// justify-content: center;
		// align-items: center;
	}
</style>